#ifndef _BVH_ACCELERATOR_H_
#define _BVH_ACCELERATOR_H_

#include <vector>
#include <algorithm>
#include "bvh_accelerator_ocl.h"


typedef struct 
{
	std::vector<primitive_info_t> primitive_array;
	std::vector<float> shape_data;
	unsigned max_primitives_in_node;
	linear_bvh_node_t *nodes;
	unsigned int linear_node_num;
}bvh_accelerator_t;


void build_bvh_accelerator(bvh_accelerator_t *bvh, const std::vector<primitive_info_t>& primitive_info_array,
	const std::vector<float>& shape_data);

std::vector<float> as_float_array(const bvh_accelerator_t* bvh);

void destroy_bvh_accelerator(bvh_accelerator_t **bvh);

#endif